package com.boot.system.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 系统部门
 *
 * @author yangfan
 * @date 2023-12-25 20:54:40
 */
@Data
@Schema(description = "系统部门")
public class SysDeptDTO implements Serializable {

    /**
     * 部门ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "部门ID")
    private String deptId;

    /**
     * 父级部门ID
     */
    @Schema(description = "父级部门ID")
    private String parentId;

    /**
     * 部门名称
     */
    @Schema(description = "部门名称")
    private String name;

    /**
     * 部门编码
     */
    @Schema(description = "部门编码")
    private String deptCode;

    /**
     * 排序
     */
    @Schema(description = "排序")
    private Integer sortOrder;

    /**
     * 机构描述
     */
    @Schema(description = "机构描述")
    private String deptDesc;

    /**
     * 下级机构
     */
    private List<SysDeptDTO>children;

    public List<SysDeptDTO> getChildren() {
        if (children==null){
            children=new ArrayList<>();
        }
        return children;
    }
}